<html>
<head>
    <title>SIMILE | Timeline | Documentation | Event Painters</title>
    <link rel='stylesheet' href='styles.css' type='text/css' />
</head>
<body>
<ul id="path">
  <li><a href="http://simile.mit.edu/" title="Home">SIMILE</a></li>
  <li><a href="../" title="Timeline">Timeline</a></li>
  <li><a href="./" title="Documentation">Documentation</a></li>
  <li><span>Event Painters</span></li>
</ul>

<div id="body">
    <h1>Event Painters</h1>
    
    <p>An <em>event painter</em> is an object made use by a <a href="bands.html"><em>band</em></a>
        to paint events.
    </p>
    
    <h2>Interface</h2>
    <p>An event painter must expose the following Javascript interface:
    </p>
    
    <div class="itf-member">
        <div class="itf-member-prototype">
            <span class="itf-member-name">constructor</span>
            ( <span class="itf-member-param">params</span> )
        </div>
        <div class="itf-member-description">
            <span class="itf-member-param">params</span> is an object whose
            fields carry initialization settings for the event painter. Different
            event painter classes require different fields in this initialization
            object. Refer to the documentation of each event painter class for
            details (see <a href="#event-painters-in-library">Event Painters in Library</a> below).
        </div>
    </div>

    <div class="itf-member">
        <div class="itf-member-prototype">
            <span class="itf-member-name">initialize</span>
            ( <span class="itf-member-param">band</span>,
            <span class="itf-member-param">timeline</span> )
        </div>
        <div class="itf-member-description">
            The event painter is to paint the events in the given
            <a href="bands.html"><span class="itf-member-param">band</span></a>
            of the given
            <a href="timelines.html"><span class="itf-member-param">timeline</span></a>.
            This method is called by the band itself as it is being 
            initialized. Client code is not supposed to call this method.
        </div>
    </div>
    
    <div class="itf-member">
        <div class="itf-member-prototype">
            <span class="itf-member-name">paint</span>
            ()
        </div>
        <div class="itf-member-description">
            (Re)paint events. The band will call this method
            when it needs to be (re)painted, at construction time as well
            as whenever its origin is shifted. Client code is not supposed
            to call this method.
        </div>
    </div>

    <div class="itf-member">
        <div class="itf-member-prototype">
            <span class="itf-member-name">softPaint</span>
            ()
        </div>
        <div class="itf-member-description">
            (Re)paint any event that is positioned
            relative to the visible area of the band. The band will call 
            this method whenever it is scrolled. Client code is not supposed
            to call this method.
        </div>
    </div>

    <h2><a name="ether-painters-in-library">Event Painters in Library</a></h2>
    <p>There is currently 1 event painter class provided by default:
        <span class="code">Timeline.<a href="duration-ether-painter.html">DurationEtherPainter</a></span>.
    </p>
</div>
</body>
</html>